var oPage = {
	lineColor:"red",
	lineWidth:1,
	boxWidth:100,
	boxHeight:100,
	boxClass:"exd-box",
	fnInit:function(){
		oPage.fnBox();
	},
	//box initiaize
	fnBox:function(){
		var box = document.querySelector("."+oPage.boxClass);
		box.style.cssText = [
			"width:",oPage.boxWidth,"px;",
			"height:",oPage.boxHeight,"px;",
			"margin-left:-",oPage.boxWidth/2,"px;",
			"margin-top:-",oPage.boxHeight/2,"px;",
			"border:solid ",oPage.lineWidth,"px ",oPage.lineColor,";"
		].join("");

		//hammer object
		var ham_box = new Hammer(box);
		ham_box.get('pinch').set({enable:true});

		//添加捏放事件
		ham_box.on('pinch',function(ev){
			console.log('pinch event',ev);
		});
	}
};

function addEvent(dom,type,fn){
	if(dom.addEventListener){
		dom.addEventListener(type,fn);
	}else if(dom.attachEvent){
		dom.attachEvent("on"+type,fn);
	}
}

addEvent(window,"load",oPage.fnInit);